package crypto.process;

/**
 * DOCUMENT ME!
 *
 * @author gato
 */
public class DistributionWeight {
  private char letter;
  private int  weight;

  /**
   * DOCUMENT ME!
   *
   * @param letter DOCUMENT ME!
   * @param text DOCUMENT ME!
   */
  public void establishWeight(char letter, String text) {
    String[] cant = text.split("" + letter);

    if (cant != null) {
      this.setWeight(cant.length - 1);
    } else {
      this.setWeight(0);
    }
  }

  /**
   * DOCUMENT ME!
   *
   * @return DOCUMENT ME!
   */
  public char getLetter() {
    return letter;
  }

  /**
   * DOCUMENT ME!
   *
   * @param letter DOCUMENT ME!
   */
  public void setLetter(char letter) {
    this.letter = letter;
  }

  /**
   * DOCUMENT ME!
   *
   * @return DOCUMENT ME!
   */
  public int getWeight() {
    return weight;
  }

  /**
   * DOCUMENT ME!
   *
   * @param weight DOCUMENT ME!
   */
  public void setWeight(int weight) {
    this.weight = weight;
  }
}
